<script setup lang="ts">
import '@/styles/anim.css'
import { ref } from 'vue'
const indexPath = ref<{
  col:number,
  row:number
}>( {col: -1, row: -1} )
const onImage = (col: number, row: number) =>{
  indexPath.value!.col = col
  indexPath.value!.row = row
}

</script>
// down-up-down-anima up-down-up-anima
<template>
  <div class="viewport">
    <div class="cloumn " 
    v-for="col in 4" :key="col" 
    :class="[ col%2 === 0 ? 'up-down-up-anima' : 'down-up-down-anima' ]">
      <div v-for="row in 20" :key="row">
        <div class="image" @click="onImage(col,row)">
          <span class="sada" v-show="indexPath!.col === col && indexPath!.row === row">
            <span class="sada-item photo-wall-play-anim" id="#left" />
            <span class="sada-item photo-wall-play-anim-center" id="#center" />
            <span class="sada-item photo-wall-play-anim" id="#right" />
          </span>
        </div>
        <div class="space">
          <span>
            SODA
          </span>
          <span>
            MUSIC
          </span>
        </div>
      </div>
    </div>
  </div>
</template>

<style lang="scss" scoped>
/*
一行4个item，最左，最右有20%超出屏幕
*/
.viewport {
  position: fixed;
  left: -10vw;
  right: -10vw;
  top: -10vh;
  bottom: -10vh;
  z-index: -66;
  display: flex;
  justify-content: space-between;
}
.cloumn {
  width: 25vw;
  height: 120vh;
  background-color: transparent;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  overflow: hidden;
}
.image {
  display: flex;
  width: 25vw;
  height: 25vw;
  background-color: transparent;
  margin-bottom: 5vw;
  background-image: url('../../../assets/IMG_4982.JPG');
  background-repeat: no-repeat;
  background-size: 25vw auto;
  border-radius: 10%;
  align-items: center;
  justify-content: center
}
.space {
  width: 25vw;
  height: 25vw;
  background-color: #333;
  margin-bottom: 5vw;
  border-radius: 10%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  span {
    text-align: center;
    font-size: 4vw;
    background-color: transparent;
    color: #666;
  }
}
.sada {
  background-color: transparent;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 6vw;
}
.sada-item {

  background-color: #fff;
  display: inline-block;
  width: 1vw;
  height: 6vw;
}

</style>

